package negocio.util;

import java.util.Date;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

public class Settings {
	@PersistenceContext(unitName = "banco")
	private static EntityManager em;
	
	public java.util.Date getDataServidor(){
		try {
			Query q = em.createNativeQuery("select current_timestamp;");
			Date d = (java.util.Date) q.getSingleResult();
			return d;
		} catch (Exception e) {
			return new Date();
		}
	 
	}
}
